package cw.itsource.controller;

import cw.itsource.service.IFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/feign")
public class FeignController {

    //注入IFeignClient，通过feign去访问所对应的服务提供者（生产者）
    @Autowired
    private IFeignClient iFeignClient;

    @GetMapping
    public String getData(){
        //调用index方法
        return iFeignClient.index();
    }

}
